package com.cc;

import com.cc.config.SpringConfig;
import com.cc.dao.BaseDao;
import com.cc.dao.MyDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;

/**
 * @ClassName: App
 * @Description:
 * @Author: 晓东√
 * @Date: 2024-09-12 08:35
 * @Version: 1.0
 **/
public class App {
    public static void main(String[] args) {
        //创建spring容器
        ApplicationContext ctx= new AnnotationConfigApplicationContext(SpringConfig.class);


       /* BaseDao baseDao = ctx.getBean(BaseDao.class);

        baseDao.showDataBase();*/

        /*MyDao myDao = ctx.getBean(MyDao.class);
        myDao.showMessage();*/

        DataSource dataSource = ctx.getBean(DataSource.class);
        System.out.println(dataSource);


    }
}
